<script setup>
import { ref } from 'vue'
const drawer = ref(false)

const toTop = () => {
  document.documentElement.scrollTop = 0;
}
</script>

<template>
  <div class="toTop">
    <i class="iconfont icon-fanhuidingbu" @click="toTop"></i>
    <p class="word" @click="toTop">顶部</p>
  </div>
</template>

<style scoped>
.iconfont {
  font-family: "iconfont" !important;
  font-size: 30px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  &:hover{
    color: red;
  }
}
.toTop{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: white;
  width: 60px;
  height: 60px;
  border-radius: 10px;

}
.word{
  font-size: 13px;
  margin: 0 5px 5px 5px;

  &:hover{
    color: red;
  }
}
</style>